//
//  XMGLoginRegisterController.m
//  百思不得姐
//
//  Created by 杨庆 on 2017/1/5.
//  Copyright © 2017年 杨庆. All rights reserved.
//

#import "XMGLoginRegisterController.h"

@interface XMGLoginRegisterController ()
/**登录框距离控制器view左边间距*/
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *loginMargin;

@property (weak, nonatomic) IBOutlet UITextField *phoneField;
@property (weak, nonatomic) IBOutlet UITextField *pwdField;
@property (weak, nonatomic) IBOutlet UIButton *loginOrRegisterBtn;

@end

@implementation XMGLoginRegisterController

- (void)viewDidLoad {
    [super viewDidLoad];
	
	
}

-(UIStatusBarStyle)preferredStatusBarStyle{
	return UIStatusBarStyleLightContent;
	
}

- (IBAction)showLoginOrRegister:(UIButton *)sender {
	//退出键盘
	[self.view endEditing:YES];
	
	if (self.loginMargin.constant==0) {
	
		self.loginMargin.constant=-self.view.width;
//		[sender setTitle:@"已有账号?" forState: UIControlStateNormal];
		sender.selected=YES;
	}else{
		self.loginMargin.constant=0;
//		[sender setTitle:@"注册账号" forState: UIControlStateNormal];
		sender.selected=NO;

	}

	
	
	[UIView animateWithDuration:0.3 animations:^{
		
		[self.view layoutIfNeeded];

	}];
	
}

-(IBAction)back{
	//退出注册视图
	[self dismissViewControllerAnimated:YES completion:^{
		XMGLog(@"---------已经退出注册控制器视图-------");
	}];

}
@end
